<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsps/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加新客户</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/application.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/form.css"/>">

	<script type="text/javascript">
		function validateFrm(){
			with(document.forms[0]){
				if(idcard_no.value ==''){
					alert("[身份证号]必须填写");
					idcard_no.focus();
					return false;
				}
				if(client_name.value == ''){
					alert("[姓名]必须填写");
					client_name.focus();
					return false;
				}
			}
			return true;
		}
	</script>
<style type="text/css">
	body {
			background:url(pics/bg.jpg);
			-webkit-background-size: cover;
			-moz-background-size: cover;
			background-size: cover;
		}
</style>
  </head>
  
  <body>
    <div id="wrapper">
    	<div id="f_title">添加客户信息</div>
    	<form action=" <c:url value="/clientMgr?act=create"/>" method="post" onSubmit="return validateFrm();">
    		<div class="f_row">
    			<span>身份证号：</span>
    			<input type = "text" name="idcard_no" size="25" value="${client.idcardNo }">
    		</div>
    		<div class="f_row">
    			<span>姓名：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
    			<input type = "text" name="client_name" value="${client.clientName }">
    		</div>
    		<div class="f_row">
    			<span>性别：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
    			<select name="client_sex">
    				<option value="B" <c:if test="${client.clientSex=='B'}">selected</c:if>>男</option>
    				<option value="G" <c:if test="${client.clientSex=='G'}">selected</c:if>>女</option>
    			</select>
    		</div>
    		<div class="f_row">
    			<span>联系电话：</span>
    			<input type = "text" name="client_phone" value="${client.clientPhone }">
    		</div>
    		<div class="f_row">
    			<span>电子邮件：</span>
    			<input type = "text" name="client_email" value="${client.clientEmail }">
    		</div>
    		<div class="f_row">
    			<span>家庭住址：</span>
    			<input type = "text" name="client_address" value="${client.clientAddress }">
    		</div>
    		<div class="f_row">
    			<span>兴趣爱好：</span>
    			<textarea rows="3" name="client_hobby">${client.clientHobby }</textarea>
    		</div>
    		
    		<div class="f_row">
    			<br/>
    			<input type="submit" value = "添加" style="height=25px;width=50px">
    		</div>
    	</form>
    </div>
    
    <c:if test="${not empty err}">
		<script type="text/javascript">
			alert('${err}');
		</script>
	</c:if>
  </body>
</html>
